<?php
namespace app\index\controller;
use \think\Controller;
use \think\Db;
class Home extends Controller
{
    public function index()
    {
    	$uid = input('uid');
    	$userData = Db::table('user')->field('uid,username,avatar,sex,level,kiss,ctime,city,sign,status')->find($uid);
    	$post = Db::table('post')->field('pid,title,ctime,view_num,is_stop,status,answer_num')->where(['uid'=>$uid])->order('ctime desc')->select();
    	$reply = Db::table('reply r')->field('r.pid,r.uid,r.content,r.ctime,p.pid,p.title')->join('post p','r.pid=p.pid')->where(['r.uid'=>$uid])->order('r.ctime desc')->select();
        return $this->fetch('index',['userData'=>$userData,'post'=>$post,'reply'=>$reply]);
    }
}
?>